<template>
  <a-card :bordered="false" class="addOrder">
    <el-page-header @back="$router.go(-1)" style="margin-bottom:10px"></el-page-header>
    <el-form
      :model="ruleForm"
      :rules="rules"
      ref="ruleForm"
      :labelWidth="labelWidth"
      class="demo-ruleForm"
    >
      <!-- 基本信息 -->
      <com-title :styleIng="{margin:'10px 0px 10px 10px'}" :isShow="false">
        <span slot="title">基本信息</span>
        <el-row :gutter="10" slot="table">
          <!-- <el-col :xs="8">
            <el-form-item label="供应商：" prop="gysmc">
              <a-select
                v-model="ruleForm.gysmc"
                placeholder="请选择供应商"
                :disabled="disabled"
                style="width:100%"
              >
                <a-select-option
                  :value="item.value"
                  v-for="(item,index) in gysmc"
                  :key="index"
                >{{item.label}}</a-select-option>
              </a-select>
            </el-form-item>
          </el-col>-->
          <el-col :xs="8">
            <el-form-item label="配送日期：" required>
              <a-date-picker @change="cxsjChange" style="width:30%">
                <a-icon slot="suffixIcon" type="smile" />
              </a-date-picker>
            </el-form-item>
          </el-col>
          <el-col :xs="8">
            <el-form-item label="备注：">
              <a-input
                v-model="ruleForm.remarks"
                style="width:30%"
                placeholder="请填写备注"
                type="textarea"
                :disabled="disabled"
              />
            </el-form-item>
          </el-col>
          <!-- <el-col :xs="8">
            <el-form-item label="配送类型：" prop="lx">
              <a-radio-group v-model="ruleForm.lx" @change="pslxChange">
                <a-radio :value="1">直通总仓</a-radio>
                <a-radio :value="2">直送门店</a-radio>
              </a-radio-group>
            </el-form-item>
          </el-col>-->
        </el-row>
      </com-title>

      <!-- 采购信息 -->
      <com-title :styleIng="{margin:'10px 0px 10px 10px'}" :isShow="false">
        <span slot="title">
          <span>采购信息</span>
          <a-button
            type="primary"
            style="margin-left:10px;position: relative;top: -3px;"
            v-if="ruleForm.lx == 2"
            @click="addStore"
          >添加直送门店</a-button>
        </span>
        <buyingIfor
          :ShopOrGoods="ruleForm.lx == 2"
          slot="table"
          ref="buyingIfor"
          style="margin:10px 0px 10px 10px"
        />
      </com-title>
      <div class="content">
        <a-button type="primary" @click="submitSave('ruleForm')">提交采购单</a-button>
        <a-button @click="quxiao('ruleForm')">取消</a-button>
      </div>
    </el-form>
    <choiceShop ref="choiceShop" @trigger="trigger" />
  </a-card>
</template>

<script src='./index.js'></script>

<style lang="less">
.addOrder {
  .content {
    text-align: center;
    margin: 20px 0px;
    button {
      margin-right: 10px;
    }
  }
}
</style>
